import request from '@/plugins/request.js'
/**
 *全局监控指标
 */
//获取User overviews 监控指标列表
export function whatResultsUser(data) {
    return request({
        url: '/what-results-user',
        method: 'GET',
        data
    })
}
//获取监控指标列表
export function getWhatResultsList(data) {
    return request({
        url: '/what-results',
        method: 'GET',
        data
    })
}
//获取 Global overviews 全局监控指标列表
export function whatResultsGlobal(data) {
    return request({
        url: '/what-results-global',
        method: 'GET',
        data
    })
}
//新增监控指标对象
export function addWhatResult(data) {
    return request({
        url: '/what-result',
        method: 'POST',
        data
    })
}
//修改监控指标对象
export function editWhatResult(data) {
    return request({
        url: '/what-result',
        method: 'PUT',
        data
    })
}
//复制监控指标对象根据id
export function copyWhatResult(data) {
    return request({
        url: '/what-result/copy/'+data,
        method: 'POST',
    })
}
//根据监控id查询选取列表
export function getWhatResult(data) {
    return request({
        url: '/what-results/'+data,
        method: 'GET',
    })
}
//删除监控指标对象根据id
export function delWhatResults(data) {
    return request({
        url: '/what-result/'+data,
        method: 'DELETE',
    })
}

// 主图表
export function getWatchChart(data){
    return request({
        url: '/watch/charts',
        method: 'GET',
        data
    })
}

// 测试值包括历史
export function getMeasured(data) {
    return request({
        url: '/measured',
        method: 'GET',
        data
    })
}
// 测试值包括历史 根据被测参数 折线图
export function getMeasuredChart(data) {
    return request({
        url: '/measured/value-chart',
        method: 'GET',
        data
    })
}
// 特性概览+数值图表
export function getOverview(data) {
    return request({
        url: '/overview',
        method: 'GET',
        data
    })
}
// 特性概览+数值图表 折线图
export function getValueChart(data) {
    return request({
        url: '/overview/value-chart',
        method: 'GET',
        data
    })
}
// /xbar-r
export function getXbarR(data) {
    return request({
        url: '/xbar-r',
        method: 'GET',
        data
    })
}

// 菜单判断是否有曲线数据
export function hasCurves(data) {
    return request({
        url: '/has-curves',
        method: 'GET',
        data
    })
}

// 时间力矩位移页面 table表头接口
export function curvesTable(data) {
    return request({
        url: '/curves-table',
        method: 'GET',
        data
    })
}

export function curvesHistory(data){
    return request({
        url: '/curves-history',
        method: 'GET',
        data
    })
}
export function curvesHistoryTree(data){
    return request({
        url: '/curves-historyTree',
        method: 'GET',
        data
    })
}

//力矩曲线表头接口
export function curvesTime(data) {
    return request({
        url: '/curves-time',
        method: 'GET',
        data
    })
}
//时间 曲线接口集合
export function curvesTime32(data) {
    return request({
        url: '/curves-time32',
        method: 'POST',
        data
    })
}

// 力矩位移接口
export function curvesForceStroke(data) {
    return request({
        url: '/curves-force-stroke',
        method: 'GET',
        data
    })
}

// 力矩位移接口集合
export function curvesForceStroke32(data) {
    return request({
        url: '/curves-force-stroke32',
        method: 'POST',
        data
    })
}


export function exportChat(data) {
    return request({
        url: '/exportChart',
        method: 'POST',
        responseType: 'blob',
        data: data
    })
}


export function exportExcelTorsion(data) {
    return request({
        url: '/measured/exportExcelTorsion',
        method: 'POST',
        responseType: 'blob',
        data: data
    })
}

export function exportExcelXAndRbar(data) {
    return request({
        url: '/measured/exportExcelXAndRbar',
        method: 'POST',
        responseType: 'blob',
        data: data
    })
}

